#ifndef REQUESTCODEC_H
#define REQUESTCODEC_H
#include <string>

#include "Codec.h"
#include "Message.pb.h"

struct RequestInfo {
  int cmdType;
  std::string clientID;
  std::string serverID;
  std::string sign;
  std::string data;
};

class RequestCodec : public Codec {
 public:
  RequestCodec();
  RequestCodec(std::string encstr);
  RequestCodec(RequestInfo const* info);
  void initMessage(std::string encstr);
  void initMessage(RequestInfo const* info);
  std::string encodeMsg();
  void* decodeMsg();
  ~RequestCodec();

 private:
  std::string m_encStr;
  RequestMsg m_msg;
};

#endif